#include"MapProtocol.hpp"

namespace SC_SUN
{

const char* SC_TIME_MSG = "SC_TIME_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScTimeMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScTimeMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_SCENE_MSG = "SC_SCENE_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScSceneMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScSceneMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_SATELLITE_LIST_MSG = "SC_SATELLITE_LIST_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScSatelliteListMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScSatelliteListMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_SATELLITE_MSG = "SC_SATELLITE_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScSatelliteMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScSatelliteMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_GNSS_MSG = "SC_GNSS_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScGnssMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScGnssMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_COLLECTION_MSG = "SC_COLLECTION_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScCollectionMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScCollectionMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_SEC_ISL_MSG = "SC_SEC_ISL_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScSecIslMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScSecIslMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_GET_SCENE_LIST_MSG = "SC_GET_SCENE_LIST_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScGetSceneListMSG& val)
{
    uint64_t sceneSize = 0;
    buff << sceneSize;
    val.scenes.resize(sceneSize);
    for (uint64_t i = 0 ; i < sceneSize; i++)
    {
        buff << val.scenes[i];
    }
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScGetSceneListMSG& val)
{
    buff >> (uint64_t)val.scenes.size();
    for (uint64_t i = 0 ; i < val.scenes.size(); i++)
    {
        buff >> val.scenes[i];
    }
    return buff;
}

const char* SC_GET_SCENE_LIST_MSG_JSON = "SC_GET_SCENE_LIST_MSG_JSON";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScGetSceneListMSGJson& val)
{
    buff << val.scenes;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScGetSceneListMSGJson& val)
{
    buff >> val.scenes;
    return buff;
}

const char* SC_SET_SCENE_MSG = "SC_SET_SCENE_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScSetSceneMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScSetSceneMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_KETI2_INFO_MSG = "SC_KETI2_INFO_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScKeTi2InfoMSG& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScKeTi2InfoMSG& val)
{
    buff >> val.msg;
    return buff;
}

const char* SC_GET_SCENE_TIME_INFO_MSG = "SC_GET_SCENE_TIME_INFO_MSG";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, SceneTimeInfoMsg& val)
{
    buff << val.mSatStep;
    buff << val.mGNSSTotal;
    buff << val.mGNSSStep;
    buff << val.mSecTotal;
    buff << val.mSecStep;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const SceneTimeInfoMsg& val)
{
    buff >> val.mSatStep;
    buff >> val.mGNSSTotal;
    buff >> val.mGNSSStep;
    buff >> val.mSecTotal;
    buff >> val.mSecStep;
    return buff;
}

const char* SC_KETI2_INFO_MSG_JSON = "SC_KETI2_INFO_MSG_JSON";
SerialOutBuffer& operator<<(SerialOutBuffer& buff, ScKeTi2InfoMSGJson& val)
{
    buff << val.msg;
    return buff;
}
SerialInBuffer& operator>>(SerialInBuffer& buff, const ScKeTi2InfoMSGJson& val)
{
    buff >> val.msg;
    return buff;
}

}